package com.kzx.blog.util;

import javax.servlet.http.HttpServletRequest;

/**
 * @author kongz
 * @version 1.0 2021/12/2 10:18
 * @description 获取请求header
 */
public class ParseHttp {

    private static final String ACCESS_TOKEN = "access_token";

    /**
     * 获取http请求中Access_token的token令牌
     * @param request 请求
     * @return token
     */
    public static String getHttpAccessToken(HttpServletRequest request) {
        String token = request.getHeader(ACCESS_TOKEN);
        if (token == null || token.equals("")) {
            return null;
        }
        return token;
    }
}
